<html>
<script>
var scope = 'empty';

navigator.serviceWorker.getRegistration(scope)
  .then(function(registration) {
      if (registration)
        registration.unregister();
    })
  .then(function() {
      var promise = navigator.serviceWorker.register('empty-worker.js',
                                                     { scope: scope });
      window.close();
      window.opener.done();
      return promise;
    })
  .catch(function(error) {
      window.opener.testFailed(error.message);
      window.opener.done();
    });
</script>
</html>
